In recent years, an increasing number of electronic devices, such as digital cameras and printers, have a wireless-LAN station function and are used as communication devices connected to a wireless LAN. For example, PTL 1 discloses a method for facilitating sharing of images by using a wireless LAN function of a digital camera.
Furthermore, Wi-Fi Alliance established a Wi-Fi Direct (registered trademark) standard. Wi-Fi Direct defines a protocol for determining whether individual electronic devices operate as a wireless-LAN access point or a wireless LAN station. Executing the protocol allows automatic determination of what electronic device serves as a wireless-LAN access point and what electronic device serves as a wireless LAN station, thus improving user convenience.
Wi-Fi Direct also defines the function of advertising and discovering information about services that upper-layer applications support as an optional function (service discovery function). This service discovery function allows the user to know information on services that a connected party holds before executing a connecting process, thus improving user convenience.
However, since the service discovery of Wi-Fi Direct (registered trademark) is an optional function, electronic devices cannot receive responses to a service search from devices that do not support the function. A conceivable method for obtaining service information from such devices that do not support service discovery is using a technique for advertising and searching for information on services executed in a communication layer higher than a wireless communication layer in which service discovery is performed. An example of the technique for advertising and searching for information on services executed in a communication layer higher than that for service discovery is Universal Plug and Play (UPnP (registered trademark)).
The above-mentioned service discovery allows a device to exchange information on services offered by the device and a partner communication device with the partner communication device by transmitting and receiving an action frame (GAS frame) defined in IEEE802.11u. Accordingly, even before performing a communication connection process for setting communication parameters, such as an IP address, necessary for communication in a layer higher than a wireless communication layer, service information can be exchanged with communication devices present in a wireless communication area. In contrast, for example, a technique for advertising and searching for information on services executed in a communication layer higher than that for service discovery, such as UPnP (registered trademark), needs to perform a connection process for setting communication parameters, such as an IP address, necessary for communication in a layer higher than a wireless communication layer. Accordingly, the timing at which a service search result is obtained using the UPnP (registered trademark) or the like is later than that of service discovery by an amount corresponding to the communication connecting process.
In such a case where a plurality of communication modes that need different processes, e.g., service searches in different communication layers are present, selection of a communication mode for improving user convenience is not under consideration in the related art.